package com.wxlsoft.config;

import javax.swing.JProgressBar;

import com.wxlsoft.config.deploy.ConfigSourceAutoDeploy;
import com.wxlsoft.config.deploy.EsbPlatform;
import com.wxlsoft.excel.core.AbstractProcessor;
import com.wxlsoft.excel.enums.HandlerConfigType;
import com.wxlsoft.utils.UIContext;

/**
 * 处理进度
 * @author wangxiaoliang
 */
public class ConfigProcessor extends AbstractProcessor {

	private ConfigSourceAutoDeploy deploy;
	
	public ConfigProcessor(HandlerConfigType ccType) {
		this.deploy = new ConfigSourceAutoDeploy(UIContext.getConfig(ccType));
	}

	@Override
	protected void read(JProgressBar progress) {
		UIContext.setProgress(progress);
	}

	@Override
	protected void write(JProgressBar progress) {
		deploy.deploy();
	}

	public EsbPlatform getPlatform() {
		return deploy.getPlatform();
	}

}
